#!/bin/bash

# apt install build-essential autoconf lynx curl gawk git vim unzip
# apt install ninja-build pkg-config libglib2.0-dev libsnappy-dev
# apt install libpixman-1-dev libaio-dev liburing-dev libseccomp-dev
# apt install libcap-ng-dev libslirp-dev libvdeplug-dev
# apt install libcurl4-gnutls-dev libudev-dev libbz2-dev
# apt install libgcrypt20-dev liblzo2-dev libnuma-dev libsnappy-dev
# apt install libusb-1.0-0-dev libfuse3-dev libjson-c-dev
# apt install libpython3-dev libxml2-dev libexpat1-dev
# apt install libncurses-dev zlib1g-dev

exec ../configure --prefix=/opt/riscv64 --cc=gcc --cxx=g++ --extra-cflags='-Wall -fPIC -Os -D_GNU_SOURCE -m64 -fno-omit-frame-pointer' \
	--extra-cxxflags='-Wall -fPIC -Os -D_GNU_SOURCE -m64 -fno-omit-frame-pointer' --extra-ldflags='-Wl,-rpath=/opt/riscv64/lib' \
	--target-list='riscv64-softmmu,riscv64-linux-user,x86_64-softmmu,x86_64-linux-user' --enable-plugins --enable-strip \
	--enable-attr --enable-bzip2  --enable-cap-ng --enable-curl --enable-fuse --enable-gcrypt --enable-kvm --enable-libudev \
	--enable-libusb --enable-linux-aio --enable-linux-io-uring --enable-lzo --enable-membarrier --enable-numa --enable-qcow1 \
	--enable-seccomp --enable-slirp --enable-snappy --enable-tools --enable-vde --enable-vdi --enable-vhost-crypto \
	--enable-vhost-kernel --enable-vhost-net --enable-vhost-user --enable-virtfs --enable-modules --disable-vmnet \
	--disable-coreaudio --disable-spice --disable-blkio --disable-gettext --disable-glusterfs --disable-gtk --disable-rdma \
	--disable-netmap --disable-vfio-user-server --disable-bochs --disable-bpf --disable-dbus-display --disable-curses \
	--disable-opengl --disable-oss --disable-alsa --disable-sdl --disable-docs --disable-selinux --disable-sndio --disable-libiscsi
